package com.qst.mapper;

import org.apache.catalina.User;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {

    @Select("select * from user where user_email=#{email} and user_password=#{password}")
    @Results(id = "userMapper",value = {
            // id字段默认为false,表示不是主键,
            // column表示数据库字段,property表示持久化类属性名称
            @Result(id=true,column = "user_id",property = "id"),
            @Result(column = "user_name",property = "username"),
            @Result(column = "user_password",property = "password"),
            @Result(column = "user_email",property = "email"),
            @Result(column = "user_role",property = "role"),
            @Result(column = "user_status",property = "status")
    })
    User login(User user);
}

